{include file="header.tpl.html"}

<div class="widthContent tableDiv radiusDiv shadowDiv darkBlueDiv2" style=" padding-top:4px;padding-bottom:4px;margin-bottom:20px;">	
	<div class="rowTableDiv ">
		<div class="cellTableDiv widthContent divFloat leftTopRadiusDiv rightTopRadiusDiv" style="border:none;"> 
			<table class="widthMax100 textColorWhite tableGridNew textAlignLeft fontStyleNew shadowTextGrey textColorGrey" style="margin: 2px;">
				<thead>
					<tr>
						<td width="30%">Data Inizio</td>
						<td width="30%">Data Fine</td>
						<td rowspan="2" align="center">
							<input type="button" value="Cerca" class="buttonNew2 effectImage radiusButton shadowButton" onclick="_submit()" />&nbsp;&nbsp;&nbsp;
							<input type="button" value="Pulisci" class="buttonNew2 effectImage radiusButton shadowButton" onclick="cleanField()" />&nbsp;&nbsp;&nbsp;
                                                        <input type="button" value="Esporta" class="buttonNew2 effectImage radiusButton shadowButton" onclick="expCsv()" />
                                                </td>
					</tr>
					<tr valign="center" style="">
						<td>
							<input type="text" name="fDataInizio" id="fDataInizio" value="{$fDataInizio}" class="inputHidden1 radiusInput widthCalendar" readOnly/>
							<input type="button" class="buttonCanc" onclick="CalendarClear('fDataInizio','','')" value="" title="Cancella Data" />&nbsp;&nbsp;
							<input type="button" class="buttonCalendar2" onclick="popupCalendar('fDataInizio',event,'{$maxDate}','','{$dataRegistrazione}')" />
						</td>
						<td>
							<input type="text" name="fDataFine" id="fDataFine" value="{$fDataFine}" class="inputHidden1 radiusInput widthCalendar" readOnly />
							<input type="button" class="buttonCanc" onclick="CalendarClear('fDataFine','','')" value="" title="Cancella Data" />&nbsp;&nbsp;
							<input type="button" class="buttonCalendar2" onclick="popupCalendar('fDataFine',event,'{$maxDate}','','{$dataRegistrazione}','fDataInizio')" />
						</td>
					</tr>
				</thead>
				</thead>
			</table>
		</div>
	</div>
</div>

<div id="divContent" class="widthContent radiusDiv shadowDiv backWhite textAlignLeft tableDiv" style="height:auto;">
	<div class="tableDiv" >
            <div class="rowTableDiv" > 
                <div class="cellTableDiv widthContent divFloat darkBlueEffect leftTopRadiusDiv rightTopRadiusDiv"  style="height: 25px;"> 
                    <table class="widthTableHead textColorWhite tableGridNew textAlignLeft" style="">
                            <thead >
                                    <tr>
					<td width="20%" onClick="orderby('cam_campagna')">
                                                    Campagna
                                                    {if $order == "cam_campagna"} 
                                                            {if $orderType== "asc"}
                                                                    <img src="images/arrowTop2.png" class="imgOrder" onmouseover="showTooltip('Ordinamento Crescente','1',0)" />
                                                            {else if  $orderType== "desc"}
                                                                    <img src="images/arrowDown2.png" class="imgOrder" onmouseover="showTooltip('Ordinamento Decrescente','1',0)" />
                                                            {/if}	
                                                    {else}
                                                            <img src="images/arrowDownGrey2.png" class="imgOrder" onmouseover="showTooltip('Nessun Ordinamento','1',0)" />
                                                    {/if}
                                            </td>
					<td width="20%" onClick="orderby('cam_campagna')">
                                                    Campagna
                                                    {if $order == "cam_campagna"} 
                                                            {if $orderType== "asc"}
                                                                    <img src="images/arrowTop2.png" class="imgOrder" onmouseover="showTooltip('Ordinamento Crescente','1',0)" />
                                                            {else if  $orderType== "desc"}
                                                                    <img src="images/arrowDown2.png" class="imgOrder" onmouseover="showTooltip('Ordinamento Decrescente','1',0)" />
                                                            {/if}	
                                                    {else}
                                                            <img src="images/arrowDownGrey2.png" class="imgOrder" onmouseover="showTooltip('Nessun Ordinamento','1',0)" />
                                                    {/if}
                                            </td>
					    <td width="20%" onClick="orderby('cam_campagna')">
                                                    Campagna
                                                    {if $order == "cam_campagna"} 
                                                            {if $orderType== "asc"}
                                                                    <img src="images/arrowTop2.png" class="imgOrder" onmouseover="showTooltip('Ordinamento Crescente','1',0)" />
                                                            {else if  $orderType== "desc"}
                                                                    <img src="images/arrowDown2.png" class="imgOrder" onmouseover="showTooltip('Ordinamento Decrescente','1',0)" />
                                                            {/if}	
                                                    {else}
                                                            <img src="images/arrowDownGrey2.png" class="imgOrder" onmouseover="showTooltip('Nessun Ordinamento','1',0)" />
                                                    {/if}
                                            </td>
                                            <td width="10%" onClick="orderby('ore_data')">
                                                    Data
                                                    {if $order == "ore_data"} 
                                                            {if $orderType== "asc"}
                                                                    <img src="images/arrowTop2.png" class="imgOrder" onmouseover="showTooltip('Ordinamento Crescente','1',0)" />
                                                            {else if  $orderType== "desc"}
                                                                    <img src="images/arrowDown2.png" class="imgOrder" onmouseover="showTooltip('Ordinamento Decrescente','1',0)" />
                                                            {/if}	
                                                    {else}
                                                            <img src="images/arrowDownGrey2.png" class="imgOrder" onmouseover="showTooltip('Nessun Ordinamento','1',0)" />
                                                    {/if}
                                            </td>
                                            <td width="20%" style="cursor:default;">Durata</td>
                                            <td width="20%" style="cursor:default;">Note</td>
                                            <td align="center" width="32%">&nbsp;</td>
                                    </tr>
                            </thead>
                    </table>
                </div>
            </div>	
	</div>
                
	<div class="rowTableDiv" >
		<div class="widthMax100 divFloat lightGreyDiv3 scrollContent"> 
			
			<table class="widthMax100 tableGridNew textAlignLeft">	
				<tbody>
					{section name=idx loop=$id}
					<tr class="{cycle values='rowDispariNew,rowPariNew'}" id="tr_{$id[idx]}">
						<td width="20%">{$campagna[idx]}</td>
						<td width="20%">{$data[idx]}</td>
                                                <td width="20%">{$durata[idx]}</td>
<!-- 						<td align="center" ><input type="button" class="buttonEdit" onclick="editItemScheda({$id[idx]})" /></td> -->
						<td width="40%">{$note[idx]}</td>
					</tr>
					{sectionelse}
						<tr >
							<td class="rowNoElements" style="font-size:14px;height:254px;">Nessun elemento trovato</td>
						</tr>	
					{/section}
				</tbody>
			</table>
		</div>
	</div>


        <div class="tableDiv" >
		<div class="rowTableDiv" >                        
			<div class="cellTableDiv widthContent divFloat darkBlueEffect leftBottomRadiusDiv rightBottomRadiusDiv"  style="height: 0px;"> 
				&nbsp;
			</div>
		</div>			
	</div>	

</div>




<input type="hidden" name="order" id="order" value="{$order}" />
<input type="hidden" name="orderType" id="orderType" value="{$orderType}" />



{include file="funcPopup.js"}
{include file="funcSelect.js"}
<script type="text/javascript" src="lib_js/calendar.js"></script>
<script type="text/javascript">
/* <![CDATA[ */

//selectOption("fCgruppo","{$fCgruppo}");
var base = 'Main.php?mod=utente&do=report&sessid={$sessid}&expDati=S'; 

{literal}



    function cleanField()
    {
        	document.main.fDataFine.value = "";
          	document.main.fDataInizio.value = "";
    }
    
    function orderby( str )
    {
	if ( document.main.order.value == str )
	{
		if ( document.main.orderType.value == 'asc' )
			document.main.orderType.value = 'desc';
		else
			document.main.orderType.value = 'asc';
	}
	else
	{
		document.main.orderType.value = 'asc';
		document.main.order.value = str;
	}
	document.main.submit();
    }
    
    function expCsv()
    {
        url = base + '&fDataInizio='+ document.main.fDataInizio.value + '&fDataFine='+ document.main.fDataFine.value;
        
        window.open(url,'csvFile','');
       
    }
    
    function _submit()
    {
        document.main.submit();
        
    }

{/literal}
/* ]]> */
</script>


{include file="usrObjPopupMsg.tpl.html"}
{include file="footer.tpl.html"}
 
 
